home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS05.ADF
/
menudemo
/
rmenu.c
< prev
next >
Wrap
C/C++ Source or Header
|
1986-01-15
|
3KB
|
112 lines
/* rmenu.c from AmigaLink 1/25/86 */
#include "standard.h"
#define MENUPROJECT 0
#define MENUEDIT 1
#define MENUSTYLES 2
#define MENUCOLORS 3
#define BLUE 0
#define WHITE 1
#define BLACK 2
#define RED 3
extern ULONG *GfxBase;
extern ULONG *IntuitionBase;
extern ULONG *DosBase;
extern ULONG *DiskfontBase;
extern struct MsgPort consoleMsgPort;
extern struct Menu *menus;
extern struct MenuItem styleitems[];
extern struct Window *OpenWindow();
extern struct Window *window;
extern struct IntuiMessage *message;
extern char *filebuffer;
extern char *filename;
closewindow(msg,w)
struct IntuiMessage *msg;
struct Window *w;
{
ReplyMsg(msg);
CDClose(); /* close the console */
ClearMenuStrip(w);
CloseWindow(w);
CloseLibrary(GfxBase);
CloseLibrary(IntuitionBase);
CloseLibrary(DosBase);
OpenWorkBench(); /* just in case */
exit(0);
}
MenuPick(message,window)
struct IntuiMessage *message;
struct Window *window;
{
ULONG ThisOne,NextOne;
ULONG choice;
NextOne = message->Code;
do {
ThisOne=NextOne;
if((MENUNUM(ThisOne))==MENUSTYLES) {
choice=ITEMNUM(ThisOne);
if( (styleitems[choice].Flags&CHECKED)==CHECKED )
CDPutStr("Processed a style\r\n");
NextOne=((struct MenuItem *)
ItemAddress(&menus,ThisOne))->NextSelect;
if (NextOne==MENUNULL)CDPutStr("processed all styles\r\n");
}
else if ((MENUNUM(ThisOne))==MENUCOLORS) {
if(ITEMNUM(ThisOne)==0)SetBPen(window->RPort,SUBNUM(ThisOne));
else SetAPen(window->RPort,SUBNUM(ThisOne));
NextOne=((struct MenuItem *)
ItemAddress(&menus,ThisOne))->NextSelect;
}
else if ((MENUNUM(ThisOne))==MENUPROJECT) {
NextOne= MENUNULL;
switch(ITEMNUM(ThisOne)) {
case 0: /* new */
CDPutStr("clear all\r\n");
break;
case 1: /* load */
CDPutStr("load a file\r\n");
break;
case 2: /* save */
CDPutStr("save a file\r\n");
break;
case 3: /* save as */
CDPutStr("save a file as\r\n");
break;
case 4: /* print */
CDPutStr("print a file\r\n");
break;
case 5: /* print as */
CDPutStr("print a file as\r\n");
break;
case 6: /* quit */
closewindow(message,window);
break;
default:
}}
else NextOne=MENUNULL; /* unknown menu message */
} while (NextOne != MENUNULL);
return(0);
}